function isPalindrome(x: number): boolean {
    let isH :boolean = true;
    let xStr :string = x.toString();
    let mid :number = 0;
    if(xStr.length % 2 === 0){
        mid = Math.trunc(xStr.length /2);
    }
    if(xStr.length % 2 !== 0){
        mid = Math.trunc(xStr.length /2) + 1 ;
    }
    for(let i=0,j=xStr.length-1;i<mid;i++,j--){
        if(xStr[i] !== xStr[j] ){
            isH = false;
        }
    }
    return isH;
};

let x = 121;
let y = 1211;
console.log(isPalindrome(x));
console.log(isPalindrome(y));